package com.zhuiyun.project.api.studentTraining.controller;

import com.zhuiyun.project.annotation.OptLog;
import com.zhuiyun.project.api.studentTraining.service.StudentTrainingService;
import com.zhuiyun.project.common.response.CommonResult;
import com.zhuiyun.project.utils.constants.CommonConstants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName StudentTrainingController
 * @Description TODO 学员端训练页面管理
 * @Author wx
 * @Date 2023/11/20 19:03
 **/
@RestController
@Api(tags = "学员端训练页面管理")
@Slf4j
@CrossOrigin
@RequestMapping("/studentTraining")
public class StudentTrainingController {
    @Autowired
    private StudentTrainingService studentTrainingService;

    /**
    * @Author wx
    * @Description 获取会员用户当日训练时间
    * @Date 2023/11/20 19:09
    * @Return
    * @param venueUniqueIdentifier
    */
    @ApiOperation(value = "获取会员用户当日训练时间")
    @OptLog(modular = "学员端训练页面管理", type = CommonConstants.SELECT, describe = "select")
    @GetMapping("/getStudentTrainingTime")
    public CommonResult getStudentTrainingTime(Integer id,String venueUniqueIdentifier){
        return CommonResult.ok(studentTrainingService.getStudentTrainingTime(id,venueUniqueIdentifier));
    }

    /**
    * @Author wx
    * @Description 获取会员用户最近一次体重记录
    * @Date 2023/11/21 8:55
    * @Return
    * @param venueUniqueIdentifier
    */
    @ApiOperation(value = "获取会员用户体重记录")
    @OptLog(modular = "学员端训练页面管理", type = CommonConstants.SELECT, describe = "select")
    @GetMapping("/getStudentTrainingWeight")
    public CommonResult getStudentTrainingWeight(Integer id,String venueUniqueIdentifier){
        return CommonResult.ok(studentTrainingService.getStudentTrainingWeight(id,venueUniqueIdentifier));
    }

    /**
     * @Author wx
     * @Description 获取会员用户前天最近一次体重记录
     * @Date 2023/11/21 8:55
     * @Return
     * @param venueUniqueIdentifier
     */
    @ApiOperation(value = "获取会员用户前天最近一次体重记录")
    @OptLog(modular = "学员端训练页面管理", type = CommonConstants.SELECT, describe = "select")
    @GetMapping("/getStudentTrainingLastWeight")
    public CommonResult getStudentTrainingLastWeight(Integer id,String venueUniqueIdentifier){
        return CommonResult.ok(studentTrainingService.getStudentTrainingLastWeight(id,venueUniqueIdentifier));
    }

    /**
    * @Author wx
    * @Description 获取会员用户所有体重记录
    * @Date 2023/11/21 9:22
    * @Return
    * @param venueUniqueIdentifier
    */
    @ApiOperation(value = "获取会员用户所有体重记录")
    @OptLog(modular = "学员端训练页面管理", type = CommonConstants.SELECT, describe = "select")
    @GetMapping("/getStudentTrainingAllWeight")
    public CommonResult getStudentTrainingAllWeight(Integer id,String venueUniqueIdentifier){
        return CommonResult.ok(studentTrainingService.getStudentTrainingAllWeight(id,venueUniqueIdentifier));
    }

    /**
    * @Author wx
    * @Description 查询近六个月的体重数据
    * @Date 2023/11/21 14:16
    * @Return
    * @param venueUniqueIdentifier
    */
    @ApiOperation(value = "查询近六个月的体重数据")
    @OptLog(modular = "学员端训练页面管理", type = CommonConstants.SELECT, describe = "select")
    @GetMapping("/getStudentTrainingSixWeight")
    public CommonResult getStudentTrainingSixWeight(Integer id,String venueUniqueIdentifier){
        return CommonResult.ok(studentTrainingService.getStudentTrainingSixWeight(id,venueUniqueIdentifier));
    }

    /**
    * @Author wx
    * @Description 查询月训练比例
    * @Date 2023/11/22 8:36
    * @Return
    * @param venueUniqueIdentifier
    */
    @ApiOperation(value = "查询月训练比例")
    @OptLog(modular = "学员端训练页面管理", type = CommonConstants.SELECT, describe = "select")
    @GetMapping("/getStudentTrainingMonth")
    public CommonResult getStudentTrainingMonth(Integer id,String venueUniqueIdentifier){
        return CommonResult.ok(studentTrainingService.getStudentTrainingMonth(id,venueUniqueIdentifier));
    }

    /**
    * @Author wx
    * @Description 查询今日训练消耗
    * @Date 2023/11/28 9:10
    * @Return
    * @param venueUniqueIdentifier
    */
    @ApiOperation(value = "查询今日训练消耗")
    @OptLog(modular = "学员端训练页面管理", type = CommonConstants.SELECT, describe = "select")
    @GetMapping("/getStudentNowkcal")
    public CommonResult getStudentNowkcal(Integer id,String venueUniqueIdentifier){
        return CommonResult.ok(studentTrainingService.getStudentNowkcal(id,venueUniqueIdentifier));
    }

    /**
    * @Author wx
    * @Description 查询会员用户信息
    * @Date 2023/11/28 10:14
    * @Return
    * @param venueUniqueIdentifier
    */
    @ApiOperation(value = "查询会员用户信息")
    @OptLog(modular = "学员端训练页面管理", type = CommonConstants.SELECT, describe = "select")
    @GetMapping("/getUserInformation")
    public CommonResult getUserInformation(Integer id,String venueUniqueIdentifier){
        return CommonResult.ok(studentTrainingService.getUserInformation(id,venueUniqueIdentifier));
    }
}
